package com.sen.common.widget.form;

import com.sen.common.widget.Attributes;
import com.sen.common.widget.Component;


/**
 * 所有Input控件的父类.
 * 
 * @author sen
 */
public abstract class Input extends Component {

	private String type;
	private String value;

	public Input(String type) {
		super("input");
		this.type = type;
	}

	public Input(String id, String name) {
		super("input");
		this.id(id).name(name);
	}
	
	public Input value(String value) {
		this.value = value;
		return this;
	}
	
	public String value() {
		return this.value;
	}

	@Override
	protected String specialAttributes() {
		return Attributes.attrIfNonblank("type", type)
				+ Attributes.attrIfNonblank("value", value);
	}
}
